﻿using B.S.Sterilizationcenter.Domain.zyy;
using B.S.Sterilizationcenter.ErrorCode;
using B.S.Sterilizationcenter.Read.API.Application.Command;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using System.Drawing;
using System.Text;

namespace B.S.Sterilizationcenter.Read.API.Controllers.ZYY.ReceivingApplications
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ReceivingApplicationController : ControllerBase
    {
        private readonly IMediator med;

        public ReceivingApplicationController(IMediator med)
        {
            this.med = med;
        }
        /// <summary>
        /// 显示领用申请
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpGet]
        public Task<ApiResult<List<ReceivingApplication>>> GetReceivingApplication([FromQuery] GetReceivingApplicationcommand request, CancellationToken cancellationToken)
        {
            return med.Send(request, cancellationToken);
        }
            [HttpGet]
           
            /// 方天领用申请
            /// </summary>
            /// <param name="request"></param>
            /// <param name="cancellationToken"></param>
            /// <returns></returns>
            public Task<ApiResult<List<ReceivingApplication>>> FanReceivingApplication([FromQuery]Fanreactioncommand request, CancellationToken cancellationToken)
        {
            return med.Send(request, cancellationToken);
        }

    }
}
